from flask import Flask
from flask_sqlalchemy import SQLAlchemy

app = Flask(
    __name__,
    template_folder="../templates",
    static_folder="../assets",
    static_url_path="/assets",
)

# 设置数据库的配置信息
# mysql://[用户名]:[密码]@[主机地址][端口号]/[数据库名]
app.config[
    "SQLALCHEMY_DATABASE_URI"
] = "mysql+mysqldb://root:123456@127.0.0.1:3306/myblog_db"
db = SQLAlchemy(app)

from routes import user_routes
from routes import admin_routes
